import Vue from "vue";
import Router from "vue-router";

Vue.use(Router);

const router = new Router({
  mode: "history",
  routes: [
    // 没有tabBar的页面写在index路由之外
    {
      // 二级路由配置  默认页为首页
      path: "/",
      name: "index",
      redirect: '/money',
      component: () => import('@/views/Index'),
      children: [
        // 资金页
        {
          path: '/money',
          name: 'money',
          component: () => import('@/views/money/Money')
        },
        // 消息页
        {
          path: '/msg',
          name: 'msg',
          component: () => import('@/views/message/Msg')
        },
        // 我的
        {
          path: '/my',
          name: 'my',
          component: () => import('@/views/my/My')
        },
        // 转入流水
        {
          path: '/zhuanruliushui',
          name: 'zhuanruliushui',
          component: () => import('@/views/money/Zhuanru')
        }
      ]
    },
    // 重定向
    {
      path: '*',
      redirect: '/money'
    },
    // 更改用户信息
    {
      path: '/change_user',
      name: 'change_user',
      component: () => import('@/views/my/ChangeUser')
    },
    // login
    {
      path: '/login',
      name: 'login',
      component: () => import('@/views/Login')
    },
    // register
    {
      path: '/register',
      name: 'register',
      component: () => import('@/views/Register')
    },
    // agreement
    {
      path: '/agreement',
      name: 'agreement',
      component: () => import('@/views/Agreement')
    },
    {
      path: '/city',
      name: 'city',
      component: () => import('@/views/City')
    },
    // 扫一扫
    {
      path: '/saoyisao',
      name: 'saoyisao',
      component: () => import('@/views/money/Saoyisao')
    },
    // 转币
    {
      path: '/zhuanbi',
      name: 'zhuanbi',
      component: () => import('@/views/money/Zhuanbi')
    },
    // 收币
    {
      path: '/shoubi',
      name: 'shoubi',
      component: () => import('@/views/money/Shoubi')
    },
    // 确认转币
    {
      path: '/qrzb',
      name: 'qrzb',
      component: () => import('@/views/money/Qrzb')
    }
  ]
});
export default router;
